class Client < ActiveRecord::Base
  validates_presence_of :first_name
  validates_presence_of :last_name
  validates_presence_of :address1
  validates_presence_of :city
  validates_presence_of :state
  validates_presence_of :country
  validates_presence_of :zip
  validates_presence_of :home_phone
  validates_presence_of :email_address
  validates_presence_of :clientcategory_id
  validates_presence_of :foundmode_id
  validates_presence_of :clientstatus_id
  validates_presence_of :foundmode_id
  validates_presence_of :county_id
  validates_presence_of :community_id
  validates_presence_of :created_by_user_id
  validates_presence_of :contact_sales_person
  validates_presence_of :registration_date
  validates_presence_of :unique_id
  validates_uniqueness_of :unique_id
  
  belongs_to :clientstatus
  belongs_to :community
  belongs_to :clientcategory
  belongs_to :county
  belongs_to :foundmode
  
  def name
    first_name + " " + last_name
  end
  
  def address
    address1 + " " + address2 + " " + city + " " + state + " " + country + " " + zip
  end
  
  def sel_county_id
    @sel_county_id
  end
  
  def sel_county_id=(county_id)
    @sel_county_id = county_id
  end
  
  def county_id_hidden
    @county_id_hidden
  end
  
  def county_id_hidden=(county_id)
    @county_id_hidden = county_id
  end

end
